package org.whb.org.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.whb.basic.util.PageList;
import org.whb.org.domain.Employee;
import org.whb.org.query.EmployeeQuery;
import org.whb.org.service.IEmployeeService;

import java.util.List;

@RestController
@RequestMapping("/employee")
public class EmployeeController {
    @Autowired
    private IEmployeeService employeeService;

    @GetMapping()
    public List<Employee> queryAll(){
        return employeeService.queryAll();
    }

    @PostMapping("/list")
    public PageList<Employee> queryPage(@RequestBody EmployeeQuery query){
        return employeeService.queryPage(query);
    }

}
